<%@ page language="java" import="java.util.*" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>
<!DOCTYPE HTML>
<html>
<head>
    <base href="<%=basePath%>">

    <title></title>

    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="cache-control" content="no-cache">
    <meta http-equiv="expires" content="0">

    <link rel="stylesheet" type="text/css" href="css/edittable.css"  >
    <link rel="stylesheet" type="text/css" href="css/validate.css"  >
    <script src="js/jquery-1.8.0.js"></script>
</head>
	<script>
		function checkKong(){
			if($("input[name=cateName]").val()==""){
				$("label").html("分类名不能为空");
				return false;
			}
			return true;
		}
		//清空
		function cleansp(){
			var sp=document.getElementsByTagName("label");
			for(var i=0;i<sp.length;i++){
				sp[i].innerHTML="";
			}
		}
		
		function tijiao(){
			cleansp();
			var fal=true;
			if(checkKong()==false){
				fal=false;
			}
			if(fal==true){
				return confirm("确认提交吗");
			}else{
				alert("有问题");
				return fal;
			}
		}
	</script>

<body>
	<div class ="div_title">
	    <div class="div_titlename"> <img src="images/san_jiao.gif" ><span>一级分类信息管理</span></div>
	</div>
	
	<form action="CateServlet.do?flog=changeCate" method="post" onsubmit="return tijiao()">
		<table class="edit_table">
		    <tr>
		    	<input type="hidden" value="${cateInfo.id }" name="id"/>
		        <td class="td_info">分类名称：</td>
		        <td class="td_input_short"><input type="text" name="cateName" value="${cateInfo.cateName}" ></td>
		        <td><label class="validate_info" name="cateNamesp"></label></td>
		    </tr>
		    <tr>
		        <td class="td_info">分类描述：</td>
		        <td class="td_input_short"><textarea rows="4" cols="27" name="des" class="txtarea" >${cateInfo.des}</textarea></td>
		        <td></td>
		    </tr>
		    <tr>
		        <td class="td_info"></td>
		        <td>
		        	<input type="submit" value="提交" class="form_btn">
		        	<input type="reset" value="重置" class="form_btn" onclick="cleansp()"></td>
		        <td></td>
		    </tr>
		</table>
	</form>
	${msg }
</body>
</html>
